// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

// ************************************************************************* //
//                            avtOpenPMDFileFormat.h                         //
// ************************************************************************* //

#ifndef VERBOSE_MODE
#define VERBOSE_MODE 0
#endif

#ifndef AVT_OpenPMD_FILE_FORMAT_H
#define AVT_OpenPMD_FILE_FORMAT_H

#include <avtMTMDFileFormat.h>
#include <avtParallel.h>

#include <vector>

// PMDFile class to handle PMD files
#include "OpenPMDClasses/PMDFile.h"

// ****************************************************************************
//  Class: avtOpenPMDFileFormat
//
//  Purpose:
//      Reads in openPMD files as a plugin to VisIt.
//
//  Programmer: mlobet -- generated by xml2avt
//  Creation:   Tue Oct 18 11:49:37 PDT 2016
//
// ****************************************************************************

class avtOpenPMDFileFormat : public avtMTMDFileFormat
{
  public:
                       avtOpenPMDFileFormat(const char *);
    virtual           ~avtOpenPMDFileFormat();

    //
    // This is used to return unconvention data -- ranging from material
    // information to information about block connectivity.
    //
    // virtual void      *GetAuxiliaryData(const char *var, int timestep, 
    //                               int domain, const char *type, void *args, 
    //                               DestructorFunction &);
    //

    //
    // If you know the times and cycle numbers, overload this function.
    // Otherwise, VisIt will make up some reasonable ones for you.
    //
    virtual void           GetCycles(std::vector<int> &);
    virtual void           GetTimes(std::vector<double> &);
    //

    virtual int            GetNTimesteps(void);
    virtual void           Initialize(void);
    
    virtual const char    *GetType(void)   { return "openPMD"; };
    virtual void           FreeUpResources(void); 

    virtual vtkDataSet    *GetMesh(int, int, const char *);
    virtual vtkDataArray  *GetVar(int, int, const char *);
    virtual vtkDataArray  *GetVectorVar(int, int, const char *);

  protected:
    // DATA MEMBERS

    bool                   initialized;
    bool                   parallel;
    int                    numTasks;
    PMDFile                openPMDFile;

    virtual void           PopulateDatabaseMetaData(avtDatabaseMetaData *, 
                                                    int);
};


#endif
